1156515 Logo RH RGB Reverse

redhat-emea-partner-2015

How Red Hat Middleware technology can simplify your Integration Development

Charles Moulliard
5th of October 2015

Who

softshake-2015

cmoulliard

Pr. Solution Architect, Fuse Expert, Apache Committer

Blog: http://cmoulliard.github.io

Twitter: @cmoulliard

Email: cmoulliard@redhat.com

  • Committer on Apache Camel, Karaf, Fabric8, Hawtio … & PMC

  • Technology evangelist

  • Mountain Biker, Belgian Beer Fan, Blogger

Agenda

softshake-2015

  • Why integration is so hard & expensive ?

  • Integration Architecture

  • How can we simplify that ?

  • Ideal Integration Platform

  • Demo

 

1156515 Logo RH RGB Reverse

Integration is so hard & expensive

Why integration is so hard ?

softshake-2015

  • Integration is Hard!

  • Different system vintages

  • Mainframe, EAI Hub, MOM, EJB, Web Services

  • Systems must collaborate

  • Team collaboration

  • Many different business to interface

esb

Why integration is so hard ?

softshake-2015

  • Protocol

  • Format

  • Data Mapping

  • Cross-domain, Per-domain

  • WSDL, XSD, JSon

integration-2

Why integration is so hard ?

softshake-2015

  • Mngt of Data Models, Mappings, BUs

  • Common vocabulary, grammar between integration actors

  • Catalogue or Registry of

    • Services

    • Data Format

    • Validation rules

lack-of-management

Why so expensive ?

softshake-2015

  • Service(s) Review (consumer/producer)

  • Code, Documentation

  • Update Testing coverage (Unit/Int.)

  • Prepare new Release(s)

  • Flow Procedures

expensive

Impact

softshake-2015

  • Existing ApplicationS

  • Business & Data Model / Services

  • Calculate Risk & Modifications

swot

 

1156515 Logo RH RGB Reverse

Integration Architecture

History

softshake-2015

  • 2000 - EAI

  • 2005 - ESB

  • 2007 - EIP

eai2

esb

Evolution

softshake-2015

  • Proprietary Standards based - JBI, SCA

  • From Standards Integration Framework

  • Architecture Centric (ESB) Distributed (Microservice - OSGI)

JBI & Centric vision

softshake-2015

  • XML based

  • Inner conversion from Format-A to XML or XML to Format-B

  • ESB Centric Platform

jbi

csv-xml

Dev Impact

softshake-2015

  • Complex to use/debug

  • Learning curve

  • Time to design/develop

  • J2EE Integration

  • Many specs to know

    • WS, WSDL

    • XSD, XML

dev_impact1

 

1156515 Logo RH RGB Reverse

How can we simplify/improve that ?

Vision

softshake-2015

jboss fuse cloud
  • Goal Integrate, Exchange, Communicate everywhere

Rethink

softshake-2015

  • Agile Project Mngt Scrum

  • Architecture Microservice

  • Automate Test, Build

  • Release more often

  • Standards & Technology used

scrum-process

microservice

Open Source

softshake-2015

  • Adopt it no more proprietary code

  • No viral license freedom to use, modify & redistribute it

oss oss1

Move to EIP

softshake-2015

eip-book

eip-patterns

DevOps vision …

softshake-2015

  • Objective Continuous Integration strategy

  • Establish a concrete pipeline to production

  • Build/Test/Release more often!

idea

See next conference about DevOps

 

1156515 Logo RH RGB Reverse

Ideal Integration Platform

Apache Camel

softshake-2015

  • Java Integration Framework (OSS)

  • Implements Domain Specific Language

  • Supports Enterprise Integration Patterns

  • Manage Complex use cases

    • correlation, aggregation

    • split, multicast

    • routing, filter

    • transformation

camel-box-small

eip_book

Java DSL

softshake-2015

  • Fluent API

package my.cool.demo;

import org.apache.camel.builder.RouteBuilder;

public class ExampleRouteBuilder extends RouteBuilder {
    @Override
    public void configure() throws Exception {

        from("amq:queue:quotes")
           .filter().xpath("/quote/product/ = 'widget")
                .bean("QuotesService", "widget")
           .filter().xpath("/quote/product/ = 'gadget")
                .bean("QuotesService","gadget");
    }
}

XML DSL

softshake-2015

  • Alternative : Spring, Blueprint

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
       http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
    ">
    <bean id="quotesService" class="my.cool.demo.camel.QuotesService"/>"

    <camelContext  xmlns="http://camel.apache.org/schema/spring">
        <route>
            <from uri="amq:queue:quotes"/>
            <filter>
                <xpath>"/quote/product/ = 'widget"</xpath>
            </filter>
                <bean id="quotesService" method="widget"/>
            <filter>
                <xpath>"/quote/product/ = 'gadget"</xpath>
            </filter>
            <bean id="quotesService" method="gadget"/>
        </route>
    </camelContext>
</beans>

Benefit

softshake-2015

  • Use Same Language, grammar between actors:

    • developer, analyst & architect

  • Adopt Domain Specific Language

Reduce Functional to Develop Time

goal

Simple Concepts

softshake-2015

  • Workflow Camel project Collection of routes

  • Route Sum of Processor(s) + Interceptor(s)

  • Route Produce or Consume Messages

pipeline

Interceptor

softshake-2015

  • To trace, log, capture business events

pipeline2

Fire / Forget pattern

softshake-2015

inonly

Request / Reply pattern

softshake-2015

inout

Convert

softshake-2015

  • Data Transformation for complex use case

package my.cool.demo;

import java.io.InputStream;
import java.io.OutputStream;
import org.apache.camel.Exchange;

public interface DataFormat {

    void marshal(Exchange exchange, Object graph, OutputStream stream) throws Exception;

    Object unmarshal(Exchange exchange, InputStream stream) throws Exception;
}
  • Marshalling : Object XML (JAXB)

  • Unmarshalling : XML Object (JAXB)

Data Format supported

Components

softshake-2015

components

Unit of Work

softshake-2015

  • CamelContext registering

  • Routes : List of Processors

  • Collection of Endpoints

camel-features

Facts

softshake-2015

  • In-Memory bus

  • Support Object : XML, File, Stream, Bytes

  • Predicate & Expression language (xslt, xpath, …)

  • Sync/Async exchanges

  • Threads Management

  • Tx Architecture

What about Testing

softshake-2015

public class FilterTest extends CamelTestSupport {

    @EndpointInject(uri = "mock:result")
    protected MockEndpoint resultEndpoint;

    @Produce(uri = "direct:start")
    protected ProducerTemplate template;

    @Test
    public void testSendMatchingMessage() throws Exception {
        String expectedBody = "<matched/>";

        resultEndpoint.expectedBodiesReceived(expectedBody);

        template.sendBodyAndHeader(expectedBody, "foo", "bar");

        resultEndpoint.assertIsSatisfied();
    }

    @Override
        protected RouteBuilder createRouteBuilder() {
            return new RouteBuilder() {
                public void configure() {
                    from("direct:start").filter(header("foo").isEqualTo("bar")).to("mock:result");
                }
        };
    }
  • Benefit from your Java JUnit Testing Knowledge

Exception handling

softshake-2015

// we do special error handling for when OrderFailedException is thrown
onException(OrderFailedException.class)
    // we mark the exchange as handled so the caller doesn't receive the
    // OrderFailedException but whatever we want to return instead
    .handled(true)
    // this bean handles the error handling where we can customize the error response
    .bean(OrderService.class, "orderFailed")
    // and since this is an unit test we use mocks for testing
    .to("mock:error");
// this is just the generic error handler where we set the destination
// and the number of redeliveries we want to try
errorHandler(deadLetterChannel("mock:error").maximumRedeliveries(1));
from("direct:start")
    // this bean is our order service
    .bean(OrderService.class, "handleOrder")
    // this is the destination if the order is OK
    .to("mock:result");
  • Capitalize your Java skills about Exception Management

More about Exception

softshake-2015

<route>
    <from uri="direct:start"/>
    <doTry>
        <process ref="processorFail"/>
        <to uri="mock:result"/>
        <doCatch>
            <exception>java.io.IOException</exception>
            <exception>java.lang.IllegalStateException</exception>
            <to uri="mock:catch"/>
        </doCatch>
        <doFinally>
            <to uri="mock:finally"/>
        </doFinally>
    </doTry>
</route>
  • Mimic Java Try/Catch/Block Structure

Integration container

softshake-2015

  • Camel routes isolated from each other (classloader)

  • Bundle CamelContext boundary acting as a Local BUS

  • Camel routes can have different SLA (Threads, Policies, …)

karaf1

Integration container

softshake-2015

  • Camel routes can be started/stopped/updated

  • Simplify maintenance process

karaf2

Management

softshake-2015

karaf4

Fabric8 v1

softshake-2015

  • Opensource integration project - http://fabric8.io

  • Mission simplify management & deployment java integration services on different machines & JVMs

fabric diagram

Features

softshake-2015

  • Manage container creation (locally, remotely, cloud, openshift, docker, …)

  • Visualise what is running into JVM to understand your platform

  • Monitor whats running and easily scaling up or down

  • Support Upgrade via Version changes and Rollback

  • Virtualize services (endpoints), processes

  • Search and storage engine for logs, camel, messages, metrics

Extends the possibilities

softshake-2015

fabric-diagram1

Console

softshake-2015

jbossfuse fabric1

Create container

softshake-2015

jbossfuse fabric2

Service

softshake-2015

jbossfuse fabric3

Discover your camel routes

softshake-2015

hawtio-3

Manage Log/Events

softshake-2015

80%

Insight Camel

softshake-2015

80%

Security

softshake-2015

  • Services & governance : Apiman

  • SSO, Oauth2 : Keycloak

apiman1

Security

softshake-2015

  • Policy based

apiman3
  • More info - see Fuse In Action Lab

Fuse World

softshake-2015

fuse technology2 donut

 

softshake-2015

1156515 Logo RH RGB Reverse

Demo

Questions

softshake-2015

questions